package com.ji.blog.controller;

import com.ji.blog.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther: jiliugang
 * @Date: 2020/6/22 15:30
 * @Description:
 */
@RestController
public class BlogController {
    @Autowired
    private UserService userService;
    @RequestMapping("test")
    @PreAuthorize("hasAnyAuthority('p1')")
    public String test(){
        String hi = userService.hi();
        return "调用成功，"+hi;
    }
}
